# Standard libraries
import wsgiref.handlers

# AppEngine imports
from google.appengine.ext import webapp

import admin
import api

import dbdisplay

from contactserver import ContactServer
from pollserver import PollServer
from recordserver import RecordServer
from commentserver import CommentServer
from display import DisplayServer
from create import CreateServer


class SanityCheck(webapp.RequestHandler):
  def get(self):
    self.response.out.write("This is poll server!")

# Map URLs to request handler class
application = webapp.WSGIApplication([('/', SanityCheck),
                                      ('/admin', admin.AdminServer),
                                      ('/db', dbdisplay.AdminServer),
                                      ('/display', DisplayServer),
                                      ('/create', CreateServer),

                                      ('/createComment', CommentServer),
                                      ('/createContact', ContactServer),
                                      ('/createPoll', PollServer),
                                      ('/createRecord', RecordServer),

                                      ('/displayComment', CommentServer),
                                      ('/displayContact', ContactServer),
                                      ('/displayPoll', PollServer),
                                      ('/displayRecord', RecordServer),
                                     ],
                                     debug=True)

wsgiref.handlers.CGIHandler().run(application)
